import 'package:flutter/material.dart';
import 'package:flutter_widget/custom/custom_appbar.dart';

// ignore: must_be_immutable
class OffStageAndVisibility extends StatelessWidget {
  String name;
  OffStageAndVisibility({Key? key, required this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CustomAppbar(name, Theme.of(context).primaryColor),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const [
            Offstage(
              child: Text('offstage为true控制影藏 false控制显示'),
              offstage: false,
            ),
            Visibility(
              child: Text('visible为false控制影藏 true控制显示'),
              visible: true,
            )
          ],
        ),
      ),
    );
  }
}
